package com.pinc.akb48;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class MyHTTPHelper {
	public static InputStream ConnectURL(String urlstr) {
		return ConnectURL(urlstr, 5000);
	}

	public static InputStream ConnectURL(String urlstr, int timeout) {
		try {
			URL url = new URL(urlstr);
			HttpURLConnection conn = (HttpURLConnection) url.openConnection();
			conn.setConnectTimeout(timeout);
			return conn.getInputStream();
		} catch (IOException e) {
			return null;
		}
	}
}
